<template>
  <div class="auth-layout">
    <div class="auth-background">
      <div class="auth-container">
        <div class="auth-content">
          <div class="auth-logo">
            <router-link to="/">
              <img src="@/assets/logo.png" alt="Logo">
            </router-link>
          </div>
          <router-view></router-view>
          <div class="auth-footer">
            <p>© {{ currentYear }} 斑马中国版权服务平台 版权所有</p>
            <div class="footer-links">
              <router-link to="/legal/agreement">用户协议</router-link>
              <span class="divider">|</span>
              <router-link to="/legal/privacy">隐私政策</router-link>
            </div>
          </div>
        </div>
        <div class="auth-banner">
          <div class="banner-content">
            <h2>斑马中国版权服务平台</h2>
            <p>为您的创作保驾护航，让每一份创意都得到应有的尊重</p>
            <div class="banner-features">
              <div class="feature-item">
                <el-icon :size="32"><Document /></el-icon>
                <span>快速存证</span>
              </div>
              <div class="feature-item">
                <el-icon :size="32"><Shield /></el-icon>
                <span>安全可靠</span>
              </div>
              <div class="feature-item">
                <el-icon :size="32"><Timer /></el-icon>
                <span>实时监测</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { defineComponent, computed } from 'vue';
import { Document, Shield, Timer } from '@element-plus/icons-vue';

export default defineComponent({
  name: 'AuthLayout',
  components: {
    Document,
    Shield,
    Timer
  },
  setup() {
    const currentYear = computed(() => new Date().getFullYear());

    return {
      currentYear
    };
  }
});
</script>

<style scoped lang="scss">
.auth-layout {
  min-height: 100vh;
  background-color: $background-color-base;
}

.auth-background {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: $spacing-base;
}

.auth-container {
  width: 100%;
  max-width: 1200px;
  min-height: 600px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: $background-color-white;
  border-radius: $border-radius-large;
  box-shadow: $box-shadow-base;
  overflow: hidden;
}

.auth-content {
  padding: $spacing-extra-large;
  display: flex;
  flex-direction: column;
}

.auth-logo {
  text-align: center;
  margin-bottom: $spacing-extra-large;

  img {
    height: 40px;
  }
}

.auth-footer {
  margin-top: auto;
  text-align: center;
  color: $text-secondary;
  font-size: $font-size-small;

  p {
    margin-bottom: $spacing-small;
  }

  .footer-links {
    a {
      color: $text-regular;
      text-decoration: none;

      &:hover {
        color: $primary-color;
      }
    }

    .divider {
      margin: 0 $spacing-small;
      color: $border-color-base;
    }
  }
}

.auth-banner {
  background: linear-gradient(135deg, $primary-color, darken($primary-color, 10%));
  padding: $spacing-extra-large;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.banner-content {
  text-align: center;

  h2 {
    font-size: $font-size-extra-large;
    margin-bottom: $spacing-base;
  }

  p {
    font-size: $font-size-large;
    opacity: 0.9;
    margin-bottom: $spacing-extra-large;
  }
}

.banner-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: $spacing-large;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: $spacing-small;

  span {
    font-size: $font-size-base;
  }
}

@media screen and (max-width: 1024px) {
  .auth-container {
    max-width: 900px;
  }
}

@media screen and (max-width: 768px) {
  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-banner {
    display: none;
  }
}

@media screen and (max-width: 480px) {
  .auth-background {
    padding: 0;
  }

  .auth-container {
    min-height: 100vh;
    border-radius: 0;
  }

  .auth-content {
    padding: $spacing-large;
  }
}
</style> 